//
//  ChatRoomTableViewCell.m
//  CoolFM
//
//  Created by 曹曹 on 16/9/1.
//  Copyright © 2016年 曹曹. All rights reserved.
//

#import "ChatRoomTableViewCell.h"
#import "ChatRoomCollectionViewCell.h"
#import "ChatRoomCollectionViewCell.h"
#import "CFMacro.h"
#import "UIView+Frame.h"

#define kCollectionViewCellReuse @"collectionViewCell"

@interface ChatRoomTableViewCell () <UICollectionViewDelegate, UICollectionViewDataSource>

@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *layout;

@end

@implementation ChatRoomTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    _collectionView.delegate = self;
    _collectionView.dataSource = self;
#warning 这里的高度看看怎么设置
    _layout.itemSize = CGSizeMake((SCREEN_WIDTH - 30) / 2.0, self.gx_height - 30);
    _layout.minimumLineSpacing = 0;
    _layout.minimumInteritemSpacing = 10;
    _layout.sectionInset = UIEdgeInsetsMake(0, 10, 0, 10);
    [_collectionView registerNib:[UINib nibWithNibName:@"ChatRoomCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:kCollectionViewCellReuse];
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return 2;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    ChatRoomCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCollectionViewCellReuse forIndexPath:indexPath];
    return cell;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
